home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / share / Dos / VARIOS / pascal / DELPHI.SWG / 0022_Making your own hotkeys.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-02-21  |  320 b   |  15 lines

  1. {
  2. Q:  How can I trap for my own hotkeys?
  3.  
  4. A:  First: set the form's KeyPreview := true;
  5.  
  6. Then, you do something like this:
  7. }
  8.  
  9. procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  10.   Shift: TShiftState);
  11. begin
  12.   if (ssCtrl in Shift) and (chr(Key) in ['A', 'a']) then
  13.     ShowMessage('Ctrl-A');
  14. end;
  15.